const express =require("express")

const app = express()

//设置秘钥,服务器用来校验token，应该放在环境变量
app.set('secret','q5eqw1212wqf')

app.use(require('cors')())
app.use(express.json())
app.use('/uploads',express.static(__dirname+'/uploads'))

require('./plugins/db')(app)
require('./routes/admin')(app)
require('./routes/web')(app)

app.listen(3000,()=>{
    console.log('http://localhost:3000')
})